﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FlyHorse.LIMS.WinApp.Utils
{
    /// <summary>
    /// 单例模式 创建窗口
    /// </summary>
    public static  class CreateForm   
    {
        private static FlyHorse.LIMS.WinApp.SystemManageForms.InitialTestItemForms.SetTestItemMainForm setTestItemMainForm;

        private static FlyHorse.LIMS.WinApp.DataManageForms.ReportRawForms.ReportRawMainForm reportRawMainForm;

        private static FlyHorse.LIMS.WinApp.DataManageForms.ReportSemiForms.ReportSemiMainForm reportSemiMainForm;

        private static FlyHorse.LIMS.WinApp.DataManageForms.ReportProductForms.ReportProductMainForm reportProductMainForm;

        private static FlyHorse.LIMS.WinApp.DataAnalyzeFroms.CurveForms.CurveMainForm curveMainForm;  


        public static FlyHorse.LIMS.WinApp.SystemManageForms.InitialTestItemForms.SetTestItemMainForm CreateFromSetTestItemMainForm()
        {
            if (setTestItemMainForm == null || setTestItemMainForm.IsDisposed)
            {
                setTestItemMainForm = new FlyHorse.LIMS.WinApp.SystemManageForms.InitialTestItemForms.SetTestItemMainForm();
            }
            else
            {
                setTestItemMainForm.WindowState = FormWindowState.Normal;
                setTestItemMainForm.Activate();
            }
            return setTestItemMainForm;
        }


        public static FlyHorse.LIMS.WinApp.DataManageForms.ReportRawForms.ReportRawMainForm CreateReportRawMainForm()
        {
            if (reportRawMainForm == null || reportRawMainForm.IsDisposed)
            {
                reportRawMainForm = new FlyHorse.LIMS.WinApp.DataManageForms.ReportRawForms.ReportRawMainForm();
            }
            else
            {
                reportRawMainForm.WindowState = FormWindowState.Maximized;
                reportRawMainForm.Activate();
            }
            return reportRawMainForm;
        }

        public static FlyHorse.LIMS.WinApp.DataManageForms.ReportSemiForms.ReportSemiMainForm CreateReportSemiMainForm()
        {
            if (reportSemiMainForm == null || reportSemiMainForm.IsDisposed)
            {
                reportSemiMainForm = new FlyHorse.LIMS.WinApp.DataManageForms.ReportSemiForms.ReportSemiMainForm();
            }
            else
            {
                reportSemiMainForm.WindowState = FormWindowState.Maximized;
                reportSemiMainForm.Activate();
            }
            return reportSemiMainForm;
        }


        public static FlyHorse.LIMS.WinApp.DataManageForms.ReportProductForms.ReportProductMainForm CreateReportProductMainForm()
        {
            if (reportProductMainForm == null || reportProductMainForm.IsDisposed)
            {
                reportProductMainForm = new FlyHorse.LIMS.WinApp.DataManageForms.ReportProductForms.ReportProductMainForm();
            }
            else
            {
                reportProductMainForm.WindowState = FormWindowState.Maximized;
                reportProductMainForm.Activate();
            }
            return reportProductMainForm;
        }

        public static FlyHorse.LIMS.WinApp.DataAnalyzeFroms.CurveForms.CurveMainForm CreateCurveMainForm()
        {
            if (curveMainForm == null || curveMainForm.IsDisposed)
            {
                curveMainForm = new FlyHorse.LIMS.WinApp.DataAnalyzeFroms.CurveForms.CurveMainForm();
            }
            else
            {
                curveMainForm.WindowState = FormWindowState.Maximized;
                curveMainForm.Activate();
            }
            return curveMainForm;
        } 

    }
}
